import {defineStore} from "pinia";

export const userStore = defineStore('currenUser', {
        state: () => {
                return {
                        nickname: '渣渣辉',
                        name: '张家辉',
                        age: 16,
                        sex: "男"
                }
        },
        getters: {
                getAddAge: (state) => {
                        return state.age = state.age + 10
                },
                getNewName: (state) => {
                        return state.name = state.name + 'A'
                }
        },
        actions: {
                forceSetNickname(nickname) {
                        return this.state.nickname = nickname
                },
                forceSetName(name) {
                        return this.state.name = name
                },

        }
})
